//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { DataAccessAuthorization, DataAccessAuthorizationResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooDataAccessAuthorizationList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<DataAccessAuthorizationResponse>(`/uctoo/data_access_authorization/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooDataAccessAuthorization = async (id: string) => {
  return requestClient.get<DataAccessAuthorization>(`/uctoo/data_access_authorization/${id}`);
};

export const adductooDataAccessAuthorization = async (data: Partial<DataAccessAuthorization>) => {
  return requestClient.post<DataAccessAuthorization>('/uctoo/data_access_authorization/add', data);
};

export const edituctooDataAccessAuthorization = async (data: Partial<DataAccessAuthorization>) => {
  return requestClient.post<DataAccessAuthorization>('/uctoo/data_access_authorization/edit', data);
};

export const deleteuctooDataAccessAuthorization = async (id: string) => {
  return requestClient.post<any>('/uctoo/data_access_authorization/del', { id });
};
